package com.b.domain;

import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
    * 视频表
    */
@Document(indexName = "video")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Video {
    /**
    * 视频ID
    */
    @Id
    @Field(type = FieldType.Integer ,store = true ,index = false)
    private Integer id;

    /**
    * 上传者ID
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer userId;

    /**
    * 标题
    */
    @Field(type = FieldType.Text ,store = true ,index = true,analyzer = "ik_max_word")
    private String title;

    /**
    * 点赞量
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer likeCount;

    /**
    * 投币量
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer coinCount;

    /**
    * 播放量
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer playCount;

    /**
    * 收藏量
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer favoriteCount;

    /**
    * 视频位置
    */
    @Field(type = FieldType.Text ,store = true)
    private String videoPath;

    /**
    * 简介
    */
    @Field(type = FieldType.Text ,store = true )
    private String description;

    /**
    * 分区ID
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer categoryId;

    /**
    * 封面图片
    */
    @Field(type = FieldType.Text ,store = true )
    private String coverImage;

    /**
    * 视频总时长（秒）
    */
    @Field(type = FieldType.Integer ,store = true ,index = true)
    private Integer alltime;

    /**
    * 发布时间
    */
//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd-HH-mm-ss")
    @Field(type = FieldType.Date ,store = true ,index = true)
    private Date publishTime;

    /**
    * 审核结果
    */
    @Field(type = FieldType.Text, index = true , store = true)
    private String result;
    /**
     * 原因
     */
    @Field(type = FieldType.Text, index = true , store = true)
    private String reason;

    @Transient
    private String categoryType;

    @Transient
    private User User;


}